package com.dream.libxrec.encode.audio;

import android.content.Context;
import android.os.Bundle;

public abstract class IAudioEncoder {

    protected IAudioEncoderListener mCb;

    public abstract IAudioEncoder init(Context ct, int sampleRate
            , int codecBitRate
            , int channelNum, Bundle extra);

    public void addIEncoderListener(IAudioEncoderListener listener){
        mCb = listener;
    }

    public abstract void encode(byte[] pcm,int offset,int size);
    public abstract void encode(byte[] pcm,
                                int offset,
                                int size,long presentationTimeUs);
    public abstract void start();

    /**
     * 是否已经启动
     * @return
     */
    public abstract boolean isRun();

    public abstract void stop();

}